// Copyright (C) 2025, ZWSOFT Co., LTD.(Guangzhou)
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System.Globalization;
using System.Windows.Controls;

namespace TestClient.ViewModel.Util;
public class NumericValidationRule : ValidationRule
{
    public override ValidationResult Validate(object value, CultureInfo cultureInfo)
    {
        if (int.TryParse((string)value, out _))
        {
            return new ValidationResult(true, null);
        }
        return new ValidationResult(false, "Please enter a valid number.");
    }
}
